package com.mipo.iflytek.cycore.jinzhou.product;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.iflytek.cycore.usercenter.api.TObject;
import com.iflytek.cycore.usercenter.api.TUser;

public class BeiLunCycoreApiTest {
	public static void main(String[] args) throws Exception {
		//reset_password_by_unique_info(); // 修改密码
		retrieveTeacherExt(); // 查询教师用户
	}
	
	// 修改密码
	public static void reset_password_by_unique_info() throws Exception {
		CyClientFactory cyClientFactory = new CyClientFactory();
		String result = cyClientFactory.createUserSvc().reset_password_by_unique_info("login_name", TObject.strVal("bl_ptls"), "123456");
		System.out.println(result);
	}
	
	// 查询教师用户
	public static void retrieveTeacherExt() throws Exception {
		CyClientFactory cyClientFactory = new CyClientFactory();
		Map<String, TObject> arg0 = new HashMap<String, TObject>();
		arg0.put("skip", TObject.intVal(0));
		arg0.put("limit", TObject.intVal(100));
		arg0.put("with_all_children", TObject.boolVal(true));
		arg0.put("app_name", TObject.strVal("rrt_nbbl"));
		arg0.put("order", TObject.strVal("-id"));
		List<TUser> result = cyClientFactory.createUserSvc().retrieve_teacher_ext(arg0);
		System.out.println(result.size());
		for (TUser t:result) {
			System.out.println(t.getLoginName());
		}
		
	}
	
	
	
	
}
